package com.koala.learn.reflectlearn;

import cn.hutool.core.util.ReflectUtil;
import com.alibaba.fastjson.JSON;
import ma.glasnost.orika.metadata.Type;
import org.junit.Test;

import java.lang.reflect.Field;

/**
 * @author yantingrui
 * @date 2022/7/4   15:41
 */
public class ResponseTest {

    public static void main(String[] args) {
        Data1 data1 = new Data1();
        data1.setName("123");
        Response<Data1> response = new Response<Data1>();
        response.setStatus(0);
        response.setData(data1);

    }

    public <T> T getC(String text, Class<T> type) {
        return JSON.parseObject(text, type);
    }


    <T> void fun(Type<T> type) {
        System.out.println(type);
    }

    /**
     *
     */
    @Test
    public void test38() {

        String key = "123";
        Field value = ReflectUtil.getField(key.getClass(), "value");
        System.out.println(value.toString());

    }


}
